import axios from '../plugin/axios/axios'

//获取轮播图列表
export const slideshowList = (position) => {
  return axios({
      url: `/api/v1/carousel/${position}`,
      method: 'GET',
  },true)
}
//轮播图添加
export const slideshowadd = (data,position) => {
    return axios({
        url: `/api/v1/carousel/${position}`,
        method: 'POST',
        data
    },true)
  }
//获取对应轮播图数据
export const slideshowpresentList = (position,targetId) => {
    return axios({
        url: `/api/v1/carousel/${position}/${targetId}`,
        method: 'GET',
    },true)
}
//修改当前轮播图
export const slideshowmodification = (data,id) => {
    return axios({
        url: `/api/v1/carousel/${id}`,
        method: 'PUT',
        data
    },true)
}
//轮播图删除
export const slideshowdelete = (id) => {
    return axios({
        url: `/api/v1/carousel/${id}`,
        method: 'DELETE',
    },true)
}
export default {
    slideshowList,
    slideshowadd,
    slideshowpresentList,
    slideshowmodification,
    slideshowdelete
}